<template>
  <div class="floor">
    <div class="py-container">
      <div class="title clearfix">
        <h3 class="fl">{{ floor.name }}</h3>
        <div class="fr">
          <ul class="nav-tabs clearfix">
            <li v-for="(list, index) in floor.navList" :key="index">
              <a :href="list.url" data-toggle="tab">{{ list.text }}</a>
            </li>
          </ul>
        </div>
      </div>
      <div class="tab-content">
        <div class="tab-pane">
          <div class="floor-1">
            <div class="blockgary">
              <ul class="jd-list">
                <li v-for="(keyword, index) in floor.keywords" :key="index">
                  {{ keyword }}
                </li>
              </ul>
              <img :src="floor.imgUrl" />
            </div>
            <div class="floorBanner">
              <div
                class="swiper-container"
                id="floor1Swiper"
                @mouseenter="swiper2.autoplay.stop()"
                @mouseleave="swiper2.autoplay.start()"
                ref="swiper2"
              >
                <div class="swiper-wrapper">
                  <div class="swiper-slide">
                    <img src="./images/floor-1-b01.png" />
                  </div>
                  <div class="swiper-slide">
                    <img src="./images/floor-1-b02.png" />
                  </div>
                  <div class="swiper-slide">
                    <img src="./images/floor-1-b03.png" />
                  </div>
                </div>
                <!-- 如果需要分页器 -->
                <div class="swiper-pagination"></div>

                <!-- 如果需要导航按钮 -->
                <div class="swiper-button-prev"></div>
                <div class="swiper-button-next"></div>
              </div>
            </div>
            <div class="split">
              <span class="floor-x-line"></span>
              <div class="floor-conver-pit">
                <img :src="floor.recommendList[0]" />
              </div>
              <div class="floor-conver-pit">
                <img :src="floor.recommendList[1]" />
              </div>
            </div>
            <div class="split center">
              <img :src="floor.bigImg" />
            </div>
            <div class="split">
              <span class="floor-x-line"></span>
              <div class="floor-conver-pit">
                <img :src="floor.recommendList[2]" />
              </div>
              <div class="floor-conver-pit">
                <img :src="floor.recommendList[3]" />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Swiper from "swiper";

export default {
  name: "Floor",
  props: ["floor"],
  mounted() {
    this.swiper2 = new Swiper(this.$refs.swiper2, {
      autoplay: {
        delay: 6000,
      },
      loop: true,
      navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev",
      },
      pagination: {
        el: ".swiper-pagination",
      },
      mousewheel: true,
      keyboard: true,
    });
  },
};
</script>

<style  lang="less" scoped>
.floor {
  overflow: hidden;
}
.py-container {
  width: 1200px;
  margin: auto;
  .title {
    border-bottom: 2px solid orange;
    line-height: 48px;
    overflow: hidden;
    .fl {
      float: left;
      font-size: 20px;
      color: orange;
      margin: 0;
      margin-top: 20px;
    }
    .fr {
      float: right;

      li {
        :first-of-type {
          border: none;
        }
        float: left;
        margin-top: 20px;
        a {
          border-left: 1px solid orange;
          padding: 0 10px;
          color: #e1251b;
        }
      }
    }
  }
}
.blockgary {
  float: left;
  width: 210px;
  .jd-list {
    padding: 15px 0;
    li {
      font-size: 12px;
      float: left;
      width: 84px;
      margin: 0 10px;
      line-height: 26px;
      text-align: center;
      border-bottom: 1px solid #eaeaea;
    }
  }
  img {
    width: 100%;
  }
}
.floorBanner {
  float: left;
  width: 330px;
}
.split {
  float: left;
  width: 220px;
  img {
    width: 100%;
    height: 100%;
  }
}
.tab-content {
  font-size: 0px;
}
</style>
